﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Dycox.Workflows
{
    public sealed class CustomOperation : TransitionOperation
    {
        public CustomOperation(ICustomTransitionOperation operation, string state)
        {
            if (operation == null)
                throw new ArgumentNullException("operation");
	
            _operation = operation;
            _state = state;
        }

        private ICustomTransitionOperation _operation;
        private string _state;

        protected override void PerformCore(TransitionOperationArguments args)
        {
            _operation.Perform(args, _state);
        }

        public override TransitionTypes SupportedTransitionTypes
        {
            get { return TransitionTypes.All; }
        }
    }

    public interface ICustomTransitionOperation
    {
        void Perform(TransitionOperationArguments args, string state);
    }
}
